package cn.lyd.controller;

import cn.lyd.domain.Emp;
import cn.lyd.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.security.PublicKey;
import java.util.List;

@Controller
@RequestMapping("/emp")
public class EmpController {

    @Autowired
    private EmpService empService;

    @RequestMapping("/getAll")
    public ModelAndView getAll() {
        ModelAndView mv = new ModelAndView();
        List<Emp> empList = empService.getAll();
        mv.addObject("empList", empList);
        mv.setViewName("emp");
        return mv;
    }




}
